<?php
// 进入物流金融模块
class FinanceAction extends Action
{
	/**
	 *index
	 * 获取金融模块下融资模式的缩略列表
	 * @access public
	 */
	public function index(){
		$this->brief_news();
		$this->brief_pattern();
		$this->brief_file();
		$this->display("Finance/finance");
	}
	/**
	* brief_news
	* 获取金融模块下行业新闻的缩略列表
	 * @access public
	 */
	public function brief_news(){
		$model = M("IndustryNews");
		$news_list = $model->where("state=1")->order("id desc")->limit(10)->select();
		$this->assign("news_list",$news_list);
	}
	/**
	* brief_pattern
	 * 获取金融模块下融资模式的缩略列表
	 * @access public
	 */
	public function brief_pattern(){
		$model = M("FundsMerge");
		$funds_list = $model->where("state=1")->order("id desc")->limit(10)->select();
		$this->assign("funds_list",$funds_list);
	}
	/**
	* brief_file
	 * 获取金融模块下资料库下载的缩略列表
	 * @access public
	 */
	public function brief_file(){
		$model = M("DatabaseFile");
		$file_list = $model->where("state=1")->order("id desc")->limit(10)->select();
		$this->assign("file_list",$file_list);
	}
	/**
	* pattern_view
	 * 详细显示某一条融资模式信息。$_GET['id']
	 * @access public
	 */
	public function pattern_view(){
		if(!empty($_GET['id'])){
			$model = M("FundsMerge");
			$vo = $model->GetById($_GET['id']);
			if($vo){
				$this->assign("vo",$vo);
				$this->display("Finance/pattern_detail");
			}else{
				$this->error("查看项不存在");
			}
		}else{
			$this->error("非法操作");
		}
	}

	/**
	* industrynews_view
	 * 详细显示某一条融资模式信息。$_GET['id']
	 * @access public
	 */
	public function industrynews_view(){
		if(!empty($_GET['id'])){
			$model = M("IndustryNews");
			$vo = $model->GetById($_GET['id']);
			if($vo){
				$this->assign("vo",$vo);
				$this->display("Finance/industrynews_detail");
			}else{
				$this->error("查看项不存在");
			}
		}else{
			$this->error("非法操作");
		}
	}
	/**
	* file_view
	 * 详细显示某一条资料下载的信息。$_GET['id']
	 * @access public
	 */
	public function file_view(){
		if(!empty($_GET['id'])){
			$model = M("DatabaseFile");
			$vo = $model->GetById($_GET['id']);
			if($vo){
				$this->assign("vo",$vo);
				$this->display("Finance/file_detail");
			}else{
				$this->error("查看项不存在");
			}
		}else{
			$this->error("非法操作");
		}
	}
}
?>